package com.zimmur.tools;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.zimmur.model.account.GoodsUser;
import com.zimmur.model.zone.Topic;

public class PageUtil_TopicCollect implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int pageNo=1; // 当前页码
	private int totalRecord; // 总记录数量
	private int totalPage; // 总页数
	private int pageSize = 10; // 每页记录数
	private List<Topic> itemList = new ArrayList<>(); // 每页记录集合
	private int pageBeginNo; // 标记
	
	private long userId=0;
	
	private GoodsUser userInfo;
	
	// 当前页码
	public int getPageNo() {
		if (pageNo < 1) {
			pageNo = 1;
		}
		return pageNo;
	}

	public void setPageNo(int pageNo) {

		this.pageNo = pageNo;
	}

	// 总记录条数
	public int getTotalRecord() {

		return totalRecord;
	}

	public void setTotalRecord(int totalRecord) {
		this.totalPage = (totalRecord % pageSize == 0 ? totalRecord / pageSize : (totalRecord / pageSize) + 1);
		this.totalRecord = totalRecord;
	}

	// 总页数
	public int getTotalPage() {
		return totalPage;
	}

	// 每页总记录条数
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	// 每页记录存储集合
	public List<Topic> getItemList() {
		return itemList;
	}

	public void setItemList(List<Topic> itemList) {
		this.itemList = itemList;
	}

	// 标记
	public int getPageBeginNo() {
		pageBeginNo = (getPageNo() - 1) * pageSize;
		return pageBeginNo;
	}

	public void setPageBeginNo(int pageBeginNo) {
		this.pageBeginNo = pageBeginNo;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public GoodsUser getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(GoodsUser userInfo) {
		this.userInfo = userInfo;
	}
		
}
